import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:home_box/pages/medicine/MedicineVM/medicine_add_vm.dart';
///药品名称
class MedicineName extends StatelessWidget {
  const MedicineName({super.key});

  @override
  Widget build(BuildContext context) {
    final MedicineVM controller = Get.find<MedicineVM>(tag: 'MedicineVM');
    return Container(
      height: 30,
      margin: EdgeInsets.only(top: 10),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Text('药品名称：', style: TextStyle(fontSize: 14)),
          Expanded(
            child: TextField(
              controller: controller.nameController,
              cursorColor: Colors.blue,
              style: TextStyle(fontSize: 14),
              decoration: InputDecoration(
                border: InputBorder.none,
                hintText: "请输入药品名称",
                hintStyle: TextStyle(fontSize: 14,color: Colors.grey),
                contentPadding: EdgeInsets.all(0),
                isDense: true,
              ),
              onChanged: (value) {
                controller.updateName(value);
              },
            ),
          ),
        ],
      ),
    );
  }
}